home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 August / PC Plus SuperCD 50b Issue 142 (CD142b) (August 1998).iso / handson / Java / sc20form.jar / com / supercede / beans / stdawt / TextAreaSB.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-01-26  |  1.4 KB  |  73 lines

  1. package com.supercede.beans.stdawt;
  2.  
  3. import java.awt.Component;
  4. import java.awt.TextArea;
  5. import java.awt.TextComponent;
  6.  
  7. public class TextAreaSB extends TextArea {
  8.    private int scrollbarVisibility;
  9.    private static final long serialVersionUID = 1013384502036516610L;
  10.    private static final int _version = 1;
  11.    private int version;
  12.  
  13.    public TextAreaSB() {
  14.       super("", 0, 0, 0);
  15.       this.version = 1;
  16.       this.scrollbarVisibility = 0;
  17.    }
  18.  
  19.    public TextAreaSB(String var1) {
  20.       super(var1, 0, 0, 0);
  21.       this.version = 1;
  22.       this.scrollbarVisibility = 0;
  23.    }
  24.  
  25.    public TextAreaSB(int var1, int var2) {
  26.       this("", var1, var2);
  27.    }
  28.  
  29.    public TextAreaSB(String var1, int var2, int var3) {
  30.       super(var1, var2, var3, 0);
  31.       this.version = 1;
  32.       this.scrollbarVisibility = 0;
  33.    }
  34.  
  35.    public TextAreaSB(String var1, int var2, int var3, int var4) {
  36.       super(var1, var2, var3, var4);
  37.       this.version = 1;
  38.       this.scrollbarVisibility = var4;
  39.    }
  40.  
  41.    public int getScrollbarVisibility() {
  42.       return this.scrollbarVisibility;
  43.    }
  44.  
  45.    public synchronized void setScrollbarVisibility(int var1) {
  46.       if (var1 != this.scrollbarVisibility) {
  47.          switch (var1) {
  48.             case 0:
  49.             case 1:
  50.             case 2:
  51.             case 3:
  52.                this.scrollbarVisibility = var1;
  53.                Object var2 = ((Component)this).getTreeLock();
  54.                synchronized(var2){}
  55.  
  56.                try {
  57.                   if (((Component)this).getPeer() != null) {
  58.                      ((TextComponent)this).removeNotify();
  59.                      ((TextArea)this).addNotify();
  60.                      ((Component)this).invalidate();
  61.                   }
  62.                } catch (Throwable var4) {
  63.                   throw var4;
  64.                }
  65.  
  66.                return;
  67.             default:
  68.                throw new IllegalArgumentException("illegal scrollbar value");
  69.          }
  70.       }
  71.    }
  72. }
  73.